package jmine.tec.script.persistent.driver;

import java.util.regex.Matcher;

/**
 * Parser de Database ID: 42
 * 
 * @author lundberg
 * @param <T> tipo de scriptbean aceito
 */
public class DatabaseIDParser<T extends ScriptBean> extends AbstractScriptParameterParser<T> {

    /**
     * Construtor
     */
    public DatabaseIDParser() {
        super("(?i)\\s*Database\\s+ID:\\s*(\\d+)\\s*");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void doParse(T bean, Matcher matcher) {
        bean.setDatabaseId(matcher.group(1));
    }
}
